char c[1002][82];
d[3000];
s;a;l;
main(w,h,i,j,x,y,n)
{
	for(scanf("%d%d\n",&w,&h);gets(c[++s]+1););
	s=0;
	for(i=1;i<=h;i++)
		for(j=1;j<=w;j++)
		{
			if(c[i][j]=='*'){d[l*2]=i;d[1+2*l++]=j;}
			while(l)
			{
				n=--l;
				x=d[2*n];
				y=d[2*n+1];
				s++;
				printf("%d %d\n",x,y);
				c[x][y]='x';
				if(c[x][y+1]=='*'){d[n*2]=x;d[n++*2+1]=y+1;c[x][y+1]='x';}
				if(c[x][y-1]=='*'){d[n*2]=x;d[n++*2+1]=y-1;c[x][y-1]='x';}
				if(c[x+1][y]=='*'){d[n*2]=x+1;d[n++*2+1]=y;c[x+1][y]='x';}
				if(c[x-1][y]=='*'){d[n*2]=x-1;d[n++*2+1]=y;c[x-1][y]='x';}
				l=n;
			}
			a=a>s?a:s;
			s=0;
		}

	for(i=1;i<=h;puts(c[i++]+1));
	printf("%d\n",a);
}
